import request from '@/utils/request'

export function login(data) {

  return request({
    url: '/w/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/w/users/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/w/logout',
    method: 'post'
  })
}

export function updatePass(user) {
  const data = {
    oldPass: user.oldPass,
    newPass: user.newPass
  }
  return request({
    url: '/w/users/updatePass/',
    method: 'post',
    data
  })
}
